package where2go.sctu.com.zhiyou.db;

import android.content.Context;
import android.support.v7.widget.LinearLayoutManager;
import android.util.AttributeSet;

/**
 * ProjectName: zhiyou
 * PackageName: where2go.sctu.com.zhiyou.db
 * Created by 张某人
 * CreatedTime:on 2018/5/2   01:52
 * Description: 重写LinearLayoutManager 解决滑动冲突
 */

public class ScrollLinearLayoutManager extends LinearLayoutManager{
    private boolean isScrollEnabled = true;

    public ScrollLinearLayoutManager(Context context) {
        super(context);
    }

    public ScrollLinearLayoutManager(Context context, int orientation, boolean reverseLayout) {
        super(context, orientation, reverseLayout);
    }

    public ScrollLinearLayoutManager(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
        super(context, attrs, defStyleAttr, defStyleRes);
    }

    public void setScrollEnabled(boolean flag) {
        this.isScrollEnabled = flag;
    }

    @Override
    public boolean canScrollVertically() {
        return isScrollEnabled && super.canScrollVertically();
    }
}

